/**
 * 
 */
package br.com.ctm.advogadope.model;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author Cleber
 * 
 */
@Entity
@DiscriminatorValue("A")
@Table(name="ADVOGADO", uniqueConstraints = {
	@UniqueConstraint(columnNames={"numeroOab", "ufOab"})
})
@XmlRootElement
public class Advogado extends Cliente {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String numeroOab;
	private String ufOab;
	private String tipoOab;

	/**
	 * 
	 */
	public Advogado() {
	}
	
	/**
	 * @return the numeroOab
	 */
	@Column(name = "NUMERO_OAB", length = 7, nullable = false)
	@Pattern(regexp = "\\d{1,7}", message = "{advogado.numeroOab.invalido}")
	public String getNumeroOab() {
		return numeroOab;
	}

	/**
	 * @param numeroOab the numeroOab to set
	 */
	public void setNumeroOab(String oab) {
		this.numeroOab = oab;
	}

	/**
	 * @return the ufOab
	 */
	@Column(name = "UF_OAB", length = 7, nullable = false)
	@NotNull(message = "{advogado.ufOab.obrigatoria}")
	@Pattern(regexp = "[A-Z]{2}", message = "{advogado.ufOab.invalida}")
	public String getUfOab() {
		return ufOab;
	}

	/**
	 * @param ufOab the ufOab to set
	 */
	public void setUfOab(String ufOab) {
		this.ufOab = ufOab;
	}

	/**
	 * @return the tipoOab
	 */
	@Column(name = "TIPO_OAB", length = 7, nullable = false)
	@NotNull(message = "{advogado.tipoOab.obrigatorio}")
	@Pattern(regexp = "[A-Z]{1}", message = "{advogado.tipoOab.invalido}")
	public String getTipoOab() {
		return tipoOab;
	}

	/**
	 * @param tipoOab the tipoOab to set
	 */
	public void setTipoOab(String tipoOab) {
		this.tipoOab = tipoOab;
	}

}
